<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Manage contacts - Magneto, by Protoweb</title>

  {include file="head-common.html"}

</head>

<body>

  {include file="header.html"}

  <div class="main container">

    <h1 class="over-bg antialias-white">Manage contacts</h1>

    {include file="messages_managment.html"}

    <div class="row">

      <div class="span12">

        <section class="well">
          <form action="{base_url}recipients/search_post/" enctype="multipart/form-data" method="post">
            <label for="keyword">Keywords:</label>
            <input name="keyword" value="{$keyword}" type="text" class="search-query span4" required="required">
            <button class="btn btn-primary" type="submit"><i class="icon-search icon-white"></i> Buscar contacto(s)</button>
          </form>

          <p>
            Podrás buscar contactos por email y nombre. Próximamente también aplicará a filtros y atributos!
          </p>

        </section>
        
        <section>

          {if isset($recipients)}
           <table class="table table-striped table-bordered">
            <thead>
              </tr>
                <th>Email</th>
                <th>Nombre</th>
              </tr>
            </thead>
              
            <tbody>
            {foreach from=$recipients item=recipient} 
              <tr>
                <td><a href="{base_url}recipients/edit/{$recipient->id}/">{$recipient->email}</a></td>
                <td><a href="{base_url}recipients/edit/{$recipient->id}/">{$recipient->fullname()}</a></td>
              </tr>
            {/foreach}
            </tbody>
          </table>
          {else}
          <p>
            Podrás buscar contactos por email y nombre. Próximamente también aplicará a filtros y atributos!
          </p>
          {/if}          

         </section>
        <!-- help & tips -->

      </div>
    </div>
    <!-- principal row -->

  </div>
  <!-- main container -->

  {include file="footer.html"}

</body>
</html>
